﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SoftwareConsulting.BI11.Studio.Core.Project.Metadata;
using SoftwareConsulting.BI11.Studio.InternalServices;

namespace SoftwareConsulting.BI11.Studio.UI.ProjectExplorer.ClassificationProblems
{
    public partial class SetClassificationProblemTypeDialog : RestorableForm
    {
        private ClassificationProblemKind _Kind;

        public ClassificationProblemKind Kind
        {
            get
            {
                return _Kind;
            }
        }
        
        /// <summary>
        /// Применяет изменения и закрывает диалог
        /// </summary>
        private void ApplyAndClose()
        {
            if (WithTrainingRadio.Checked)
            {
                _Kind = ClassificationProblemKind.WithTraining;
            }
            else
            {
                _Kind = ClassificationProblemKind.OnHierarchy;
            }
            DialogResult = DialogResult.OK;
            Close();
        }

        public SetClassificationProblemTypeDialog()
        {
            InitializeComponent();
        }

        private void OKButton_Click(object sender, EventArgs e)
        {
            ApplyAndClose();
        }
    }
}
